Hi All,
string empty_list[] = {}
DB TestMatrixDB = create ("Test Matrix Selection",styleFixed|styleCentered|styleFloating)
DBE CurrentTestsDBE = listView(TestMatrixDB,0,200,15,empty_list)
DBE matrixFile = label (TestMatrixDB, "Target Document")
DBE ms = fileName TestMatrixDB
set(ms, "*.xls", "Excel Document")
void exportMatrix(DB db)
{
string seltest = get(CurrentTestsDBE)
string file = get(ms)
Item itemRef
Module m
for itemRef in (current Folder)do
{
if ((name(itemRef)) == seltest)
{
m = read((name(itemRef)),true)
load view "VCRI"
}
}
//Then create buffer for output file
}
void getMatrix()
{
apply (TestMatrixDB,"Export",exportMatrix)
realize (TestMatrixDB)
Item itemRef
ModuleProperties mp
Module m
for itemRef in (current Folder) do
{
if (type(itemRef) == "Formal")
{
ModuleVersion mv = moduleVersion(module(name(itemRef)))
string res = getProperties(mv, mp)
if (res != "")
{
infoBox("Error reading properties: " res)
halt
}
if ((name(itemRef)) != "Test Module template")
{
insert (CurrentTestsDBE,0,(name(itemRef)))
}
}
}
set(CurrentTestsDBE,testSelect,testDeselect,testActivate)
insertColumn(CurrentTestsDBE,0,"Current Tests",200,iconNone)
}
getMatrix()
mwilliamson - Mon Nov 02 05:24:25 EST 2009 |
Re: Unassigned variable issue Adding "show TestMatrixDB" to the end of your script makes it work, but you must keep in mind that DXL execution ends after that line. No code should appear after a show as it would never be executed. Regards, Peter |
Re: Unassigned variable issue Peter_Albert - Mon Nov 02 07:46:04 EST 2009 I am kicking myself as I have done this hundreds of times before. Sometimes the the more obvious the silly error the harder it is to find. I think that this is the consequence of rationalisng a large DXL script into smaller more managemable and reusable functions. Thank you very much for your prompt response. Regards Mark |